package common.spring.auditlog.controller;
import common.spring.auditlog.entity.DeviceSensor;
import common.spring.auditlog.service.DeviceSensorService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/dsc")
public class DeviceSensorController {
    @Autowired
    private DeviceSensorService deviceSensorService;


    @RequestMapping(value = "finbById")
    public DeviceSensor finbById(@RequestBody DeviceSensor deviceSensor){
        return deviceSensorService.selectByPrimaryKey(deviceSensor.getId());
    }
    @RequestMapping(value = "add")
    public int insert(@RequestBody DeviceSensor deviceSensor){
        return deviceSensorService.insert(deviceSensor);
    }
    @RequestMapping(value = "update")
    public int update(@RequestBody DeviceSensor deviceSensor){
        return deviceSensorService.updateByPrimaryKey(deviceSensor);
    }
    @RequestMapping(value = "delete")
    public int delete(@RequestBody DeviceSensor deviceSensor){
        return deviceSensorService.deleteByPrimaryKey(deviceSensor.getId());
    }
}
